<template>
	<view class="height-screen relative">
		<image src="@/static/img/customBg.png" style="height: 628rpx;width: 100vw;" class="absolute" />
		<cu-custom backColor="text-black" isBack>
			<block slot="content">
				<text class="text-black">{{$t('filed.lianxi')}}</text>
			</block>
		</cu-custom>
		<view class="bg-white padding-lg margin-ht radius-sm grid"
			style="box-shadow: 0rpx 4rpx 16rpx 0rpx rgba(102,102,102,0.16);gap: 50rpx;"
			:style="{marginTop:`calc(628rpx - ${CustomBar}px)`}">
			<view class="flex justify-between align-center">
				<text>{{$t('filed.dianhua')}}：{{phone}}</text>
				<view class="setButton radius-sm" @tap.stop="setClipboardData(phone)"
					style="width: 75rpx;height: 35rpx;background: rgba(6, 193, 104, 0.1);">
					<text class="text-sm font-400" style="color: #06C168;">{{$t('filed.copy')}}</text>
				</view>
			</view>
			<view class="flex justify-between align-center">
				<text>{{$t('filed.email')}}：{{email}}</text>
				<view class="setButton radius-sm" @tap.stop="setClipboardData(email)"
					style="width: 75rpx;height: 35rpx;background: rgba(6, 193, 104, 0.1);">
					<text class="text-sm font-400" style="color: #06C168;">{{$t('filed.copy')}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		customLink
	} from '@/apis'
	export default {
		data() {
			return {
				CustomBar: this.CustomBar,
				phone: '',
				email: ''
			}
		},
		onShow() {
			this.customLink()
		},
		methods: {
			async customLink() {
				const res = await customLink()
				this.phone = res.phone
				this.email = res.email
			},
			setClipboardData(content) {
				uni.setClipboardData({
					data: content,
					success: () => {
						this.helper.showToast(this.$t('message.success'))
					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
</style>